export function groupByKeys (array, keys) {
  if (!keys) return array
  const list = array || []
  const data = []
  const groups = []
  for (let i = 0; i < list.length; i++) {
    const item = list[i]
    const key = {}
    for (let j = 0; j < keys.length; j++) {
      const k = keys[j]
      key[k] = item[k]
    }
    let group = groups.find(ele => {
      return ele._key === JSON.stringify(key)
    })
    if (!group) {
      group = {
        _key: JSON.stringify(key),
        key: key
      }
      groups.push(group)
    }
    group.data = group.data || []
    group.data.push(item)
  };
  groups.forEach(valid => {
    data.push(valid.data)
  })
  return data
}
// 获取本月天数
export function mGetDate () {
  const date = new Date()
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const d = new Date(year, month, 0)
  return d.getDate()
}
